package com.ihg.hiex.admin.entity.dto;

/**
 * 
 * @author houtao
 *
 */
public class DriveResult {
    
    private String assessorEvalution;
    
    private String internalBenchmark;
    
    private String externalBenchmark;
    
    private int cqxd;
    
    private int zqmb;
    
    private int gzgl;
    
    private int aswcrw;
    
    private int cgcc;
    
    private int tcxf;
    
    private int dxwt;
    
    private int potential;
    
    /**
     * 
     */
    public DriveResult() {
    }
    
    /**
     * 
     * @param cqxd
     * @param zqmb
     * @param gzgl
     * @param aswcrw
     * @param cgcc
     * @param tcxf
     * @param dxwt
     */
    public DriveResult(int cqxd, int zqmb, int gzgl, int aswcrw, int cgcc, int tcxf, int dxwt) {
    	this.cqxd = cqxd;
        this.zqmb = zqmb;
        this.gzgl = gzgl;
        this.aswcrw = aswcrw;
        this.cgcc = cgcc;
        this.tcxf = tcxf;
        this.dxwt = dxwt;
        
        double po =  (cqxd + aswcrw + cgcc + tcxf) * 0.083333333333
                + (gzgl + zqmb)* 0.25 + (dxwt) * 0.166666666;
        
        if(po > new Double(7.00)) {
    		this.potential = new Integer(10);
    	} else if (po > new Double(6.57)) {
    		this.potential = new Integer(9);
    	} else if (po > new Double(6.29)) {
    		this.potential = new Integer(8);
    	} else if (po > new Double(5.86)) {
    		this.potential = new Integer(7);
    	} else if (po > new Double(5.43)) {
    		this.potential = new Integer(6);
    	} else if (po > new Double(5.14)) {
    		this.potential = new Integer(5);
    	} else if (po > new Double(4.71)) {
    		this.potential = new Integer(4);
    	} else if (po > new Double(4.43)) {
    		this.potential = new Integer(3);
    	} else if (po > new Double(4.00)) {
    		this.potential = new Integer(2);
    	} else {
    		this.potential = new Integer(1);
    	}
                
        //this.potential = new Double(po).intValue();
    }
    
    /**
     * 
     * @param assessorEvalution
     * @param internalBenchmark
     * @param externalBenchmark
     * @return
     */
    public DriveResult init(String assessorEvalution, String internalBenchmark, String externalBenchmark) {
        this.assessorEvalution = assessorEvalution;
        this.internalBenchmark = internalBenchmark;
        this.externalBenchmark = externalBenchmark;
        return this;
    }

	/**
	 * 
	 * @param cqxd
	 * @param zqmb
	 * @param gzgl
	 * @param aswcrw
	 * @param cgcc
	 * @param tcxf
	 * @param dxwt
	 * @return
	 */
	public DriveResult init(int cqxd, int zqmb, int gzgl, int aswcrw, int cgcc, int tcxf, int dxwt) {
		
		this.cqxd = cqxd;
        this.zqmb = zqmb;
        this.gzgl = gzgl;
        this.aswcrw = aswcrw;
        this.cgcc = cgcc;
        this.tcxf = tcxf;
        this.dxwt = dxwt;
        
        double po =  (cqxd + aswcrw + cgcc + tcxf) * 0.083333333333
                + (gzgl + zqmb)* 0.25 + (dxwt) * 0.166666666;
        
        if(po > new Double(7.00)) {
    		this.potential = new Integer(10);
    	} else if (po > new Double(6.57)) {
    		this.potential = new Integer(9);
    	} else if (po > new Double(6.29)) {
    		this.potential = new Integer(8);
    	} else if (po > new Double(5.86)) {
    		this.potential = new Integer(7);
    	} else if (po > new Double(5.43)) {
    		this.potential = new Integer(6);
    	} else if (po > new Double(5.14)) {
    		this.potential = new Integer(5);
    	} else if (po > new Double(4.71)) {
    		this.potential = new Integer(4);
    	} else if (po > new Double(4.43)) {
    		this.potential = new Integer(3);
    	} else if (po > new Double(4.00)) {
    		this.potential = new Integer(2);
    	} else {
    		this.potential = new Integer(1);
    	}
				
		//this.potential = new Double(po).intValue();		
    	return this;
    }


	public String getAssessorEvalution() {
		return assessorEvalution;
	}


	public void setAssessorEvalution(String assessorEvalution) {
		this.assessorEvalution = assessorEvalution;
	}


	public String getInternalBenchmark() {
		return internalBenchmark;
	}


	public void setInternalBenchmark(String internalBenchmark) {
		this.internalBenchmark = internalBenchmark;
	}


	public String getExternalBenchmark() {
		return externalBenchmark;
	}


	public void setExternalBenchmark(String externalBenchmark) {
		this.externalBenchmark = externalBenchmark;
	}


	public int getCqxd() {
		return cqxd;
	}


	public void setCqxd(int cqxd) {
		this.cqxd = cqxd;
	}


	public int getZqmb() {
		return zqmb;
	}


	public void setZqmb(int zqmb) {
		this.zqmb = zqmb;
	}


	public int getGzgl() {
		return gzgl;
	}


	public void setGzgl(int gzgl) {
		this.gzgl = gzgl;
	}


	public int getAswcrw() {
		return aswcrw;
	}


	public void setAswcrw(int aswcrw) {
		this.aswcrw = aswcrw;
	}


	public int getCgcc() {
		return cgcc;
	}


	public void setCgcc(int cgcc) {
		this.cgcc = cgcc;
	}


	public int getTcxf() {
		return tcxf;
	}


	public void setTcxf(int tcxf) {
		this.tcxf = tcxf;
	}


	public int getDxwt() {
		return dxwt;
	}


	public void setDxwt(int dxwt) {
		this.dxwt = dxwt;
	}


	public int getPotential() {
		return potential;
	}


	public void setPotential(int potential) {
		this.potential = potential;
	}
}
